<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class TestCastJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $params;

    /**
     * Create a new job instance.
     * @param $params
     * @return void
     */
    public function __construct($params)
    {
        //
        $this->params = $params;
        Log::channel('job')->info('job construct params : ' . json_encode($params));
    }

    public function failed()
    {
        Log::channel('job')->info('enter failed : ' . json_encode($this->params));
        return true;
    }

    /**
     * Execute the job.
     *
     * @return mixed
     */
    public function handle()
    {
        //
        Log::channel('job')->info('enter handle : ' . json_encode($this->params));
        return true;
    }
}
